home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / out < prev    next >
Encoding:
Text File  |  1991-09-03  |  57.1 KB  |  2,118 lines

  1. # 1 "ds3100.md/mips-tdep.c"
  2. # 1 "/sprite/lib/include/stdio.h"
  3. # 1 "/sprite/lib/include/cfuncproto.h"
  4. # 44 "/sprite/lib/include/cfuncproto.h"
  5. # 52 "/sprite/lib/include/cfuncproto.h"
  6. # 59 "/sprite/lib/include/cfuncproto.h"
  7. # 65 "/sprite/lib/include/cfuncproto.h"
  8. # 71 "/sprite/lib/include/cfuncproto.h"
  9. typedef char *_VoidPtr;
  10. # 33 "/sprite/lib/include/stdio.h"
  11. # 36 "/sprite/lib/include/stdio.h"
  12. typedef int *ClientData;
  13. typedef char *va_list;
  14. typedef struct _file {
  15.     unsigned char *lastAccess;    
  16.     int readCount;        
  17.     int writeCount;        
  18.     unsigned char *buffer;    
  19.     int bufSize;        
  20.     void (*readProc)    ();
  21.     void (*writeProc)    ();
  22.     int (*closeProc)    ();
  23.     ClientData clientData;    
  24.     int status;            
  25.     int flags;            
  26.     struct _file *nextPtr;    
  27. } FILE;
  28. # 214 "/sprite/lib/include/stdio.h"
  29. extern FILE stdioInFile, stdioOutFile, stdioErrFile;
  30.         extern void    clearerr     ();
  31.         extern int    fclose     ();
  32.         extern FILE *    fdopen     ();
  33.         extern int    fflush     ();
  34.         extern int    fgetc     ();
  35.         extern char *    fgets     ();
  36.         extern int    fileno     ();
  37.         extern FILE *    fopen     ();
  38.         extern int    fputc     ();
  39.         extern int    fputs     ();
  40.         extern int    fread 
  41.     ();
  42.         extern FILE *    freopen 
  43.     ();
  44.         extern long    fseek     ();
  45.         extern long    ftell     ();
  46.         extern int    fwrite 
  47.     ();
  48.         extern char *    gets     ();
  49.         extern int    getw     ();
  50.         extern void    perror     ();
  51.         extern FILE *    popen     ();
  52.         extern int    pclose     ();
  53.         extern int      remove     ();
  54.         extern int      rename     ();
  55. # 338 "/sprite/lib/include/stdio.h"
  56.         extern int    printf     ();
  57.         extern int    fprintf     ();
  58.         extern int    scanf     ();
  59.         extern char *    sprintf     ();
  60.         extern int    sscanf     ();
  61.         extern int    fscanf     ();
  62.         extern int    vfprintf 
  63.     ();
  64.         extern int    vfscanf 
  65.     ();
  66.         extern int    vprintf     ();
  67.         extern char *    vsprintf 
  68.     ();
  69.         extern int    puts     ();
  70.         extern int    putw     ();
  71.         extern void    rewind     ();
  72.         extern void    setbuf     ();
  73.         extern void    setbuffer     ();
  74.         extern void    setlinebuf     ();
  75.         extern int    setvbuf     ();
  76.         extern FILE *    tmpfile     ();
  77.         extern char *    tmpnam     ();
  78.         extern char *    tempnam     ();
  79.         extern int    ungetc     ();
  80.         extern void    _cleanup     ();
  81.         extern void    Stdio_Setup 
  82.     ();
  83. # 28 "ds3100.md/mips-tdep.c"
  84. # 1 "ds3100.md/mips/inst.h"
  85. # 53 "ds3100.md/mips/inst.h"
  86. union mips_instruction {
  87.     unsigned word;
  88.     unsigned char byte[4];
  89.     struct {
  90.         unsigned target : 26;
  91.         unsigned opcode : 6;
  92.     } j_format;
  93.     struct {
  94.         signed simmediate : 16;
  95.         unsigned rt : 5;
  96.         unsigned rs : 5;
  97.         unsigned opcode : 6;
  98.     } i_format;
  99.     struct {
  100.         unsigned uimmediate : 16;
  101.         unsigned rt : 5;
  102.         unsigned rs : 5;
  103.         unsigned opcode : 6;
  104.     } u_format;
  105.     struct {
  106.         unsigned func : 6;
  107.         unsigned re : 5;
  108.         unsigned rd : 5;
  109.         unsigned rt : 5;
  110.         unsigned rs : 5;
  111.         unsigned opcode : 6;
  112.     } r_format;
  113.     struct {
  114.         unsigned func : 6;
  115.         unsigned re : 5;
  116.         unsigned rd : 5;
  117.         unsigned rt : 5;
  118.         unsigned fmt : 4;
  119.         unsigned : 1;
  120.         unsigned opcode : 6;
  121.     } f_format;
  122. };
  123. # 545 "ds3100.md/mips/inst.h"
  124. # 29 "ds3100.md/mips-tdep.c"
  125. # 1 "./defs.h"
  126. typedef unsigned int CORE_ADDR;
  127. # 43 "./defs.h"
  128. # 53 "./defs.h"
  129. extern char *savestring ();
  130. extern char *strsave ();
  131. extern char *concat ();
  132. # 64 "./defs.h"
  133. extern char *xmalloc (), *xrealloc ();
  134. extern void free ();
  135. extern int parse_escape ();
  136. extern char *reg_names[];
  137. extern  void error(), fatal();
  138. # 77 "./defs.h"
  139. # 80 "./defs.h"
  140.    extern char *alloca ();
  141. extern int errno;            
  142. extern int quit_flag;
  143. extern int immediate_quit;
  144. extern void quit ();
  145. enum command_class
  146. {
  147.   all_classes = -2, all_commands = -1,
  148.   no_class = -1, class_run = 0, class_vars, class_stack,
  149.   class_files, class_support, class_info, class_breakpoint,
  150.   class_alias, class_obscure, class_user
  151. };
  152. struct cleanup
  153. {
  154.   struct cleanup *next;
  155.   void (*function) ();
  156.   int arg;
  157. };
  158. extern void do_cleanups ();
  159. extern void discard_cleanups ();
  160. extern struct cleanup *make_cleanup ();
  161. extern struct cleanup *save_cleanups ();
  162. extern void restore_cleanups ();
  163. extern void free_current_contents ();
  164. extern int myread ();
  165. extern int query ();
  166. extern int lines_to_list ();
  167. extern void wrap_here (
  168. # 136 "./defs.h"
  169.                );
  170. extern void reinitialize_more_filter ();
  171. extern void fputs_filtered ();
  172. extern void puts_filtered ();
  173. extern void fprintf_filtered ();
  174. extern void printf_filtered ();
  175. extern void print_spaces ();
  176. extern void print_spaces_filtered ();
  177. extern char *n_spaces ();
  178. extern void printchar ();
  179. extern void fprint_symbol ();
  180. extern void fputs_demangled ();
  181. extern void perror_with_name ();
  182. extern void print_sys_errmsg ();
  183. extern void print_address_symbolic ();
  184. extern void print_address ();
  185. void mod_path (
  186. # 160 "./defs.h"
  187.            );
  188. extern char *tilde_expand ();
  189. struct command_line
  190. {
  191.   struct command_line *next;
  192.   char *line;
  193. };
  194. extern struct command_line *read_command_lines ();
  195. extern void free_command_lines ();
  196. char *current_directory;
  197. extern unsigned input_radix;
  198. extern unsigned output_radix;
  199. char *baud_rate;
  200. # 225 "./defs.h"
  201. # 30 "ds3100.md/mips-tdep.c"
  202. # 1 "./param.h"
  203. # 1 "ds3100.md/tm.h"
  204. # 1 "/sprite/lib/include/ds3100.md/kernel/vmPmaxConst.h"
  205. # 24 "ds3100.md/tm.h"
  206. # 80 "ds3100.md/tm.h"
  207. typedef struct mips_extra_func_info {
  208.     unsigned long    adr;    
  209.     long    isym;        
  210.     long    pad2;        
  211.     long    regmask;    
  212.     long    regoffset;    
  213.     long    numargs;    
  214.     long    fregmask;    
  215.     long    fregoffset;    
  216.     long    framesize;    
  217.     short    framereg;    
  218.     short    pcreg;        
  219.     long    lnLow;        
  220.     long    lnHigh;        
  221.     long    pad3;        
  222. } *mips_extra_func_info_t;
  223. # 28 "./param.h"
  224. # 1 "./param-no-tm.h"
  225. # 1 "ds3100.md/xm.h"
  226. # 25 "./param-no-tm.h"
  227. # 29 "./param-no-tm.h"
  228. # 42 "./param-no-tm.h"
  229. # 65 "./param-no-tm.h"
  230. # 31 "./param.h"
  231. # 31 "ds3100.md/mips-tdep.c"
  232. # 1 "./frame.h"
  233. # 1 "./param.h"
  234. # 28 "./param.h"
  235. # 1 "./param-no-tm.h"
  236. # 82 "./param-no-tm.h"
  237. # 31 "./param.h"
  238. # 23 "./frame.h"
  239. typedef struct frame_info *FRAME;
  240. typedef CORE_ADDR    FRAME_ADDR;
  241. struct frame_info
  242.   {
  243.     FRAME_ADDR frame;
  244.     CORE_ADDR pc;
  245.     FRAME_ADDR next_frame;
  246.       char *proc_desc;   int num_args;  struct frame_saved_regs *saved_regs;
  247.     FRAME next, prev;
  248.   };
  249. struct frame_saved_regs
  250.   {
  251.     CORE_ADDR regs[73];
  252.   };
  253. extern FRAME selected_frame;
  254. extern struct frame_info *get_frame_info ();
  255. extern struct frame_info *get_prev_frame_info ();
  256. extern FRAME create_new_frame ();
  257. extern void  flush_cached_frames ();
  258. extern void reinit_frame_cache ();
  259. extern void get_frame_saved_regs ();
  260. extern void  set_current_frame ();
  261. extern FRAME get_prev_frame ();
  262. extern FRAME get_current_frame ();
  263. extern FRAME get_next_frame ();
  264. extern struct block *get_frame_block ();
  265. extern struct block *get_current_block ();
  266. extern struct block *get_selected_block ();
  267. extern struct symbol *get_frame_function ();
  268. extern CORE_ADDR get_frame_pc ();
  269. extern CORE_ADDR get_pc_function_start ();
  270. struct block *block_for_pc ();
  271. int frameless_look_for_prologue ();
  272. void print_frame_args ();
  273. extern FRAME find_relative_frame ();
  274. extern void print_selected_frame ();
  275. extern void print_sel_frame ();
  276. extern void select_frame ();
  277. extern void record_selected_frame ();
  278. # 32 "ds3100.md/mips-tdep.c"
  279. # 1 "./inferior.h"
  280. # 1 "./breakpoint.h"
  281. extern void breakpoint_re_set ();
  282. extern void clear_momentary_breakpoints ();
  283. extern void set_momentary_breakpoint ();
  284. extern void set_ignore_count ();
  285. extern void set_default_breakpoint ();
  286. extern void mark_breakpoints_out ();
  287. extern void breakpoint_auto_delete ();
  288. extern void breakpoint_clear_ignore_counts ();
  289. extern void disable_current_display ();
  290. extern void do_displays ();
  291. extern void disable_display ();
  292. extern void clear_displays ();
  293. typedef struct bpstat__struct *bpstat;
  294. void bpstat_clear();
  295. bpstat bpstat_copy();
  296. bpstat bpstat_stop_status ();
  297. int bpstat_should_step ();
  298. int bpstat_print ();
  299. int bpstat_num ();
  300. void bpstat_do_actions ();
  301. void bpstat_clear_actions ();
  302. # 1 "./value.h"
  303. enum lval_type {
  304.   not_lval,
  305.   lval_memory,
  306.   lval_register,
  307.   lval_internalvar,
  308.   lval_internalvar_component,
  309.   lval_reg_frame_relative,
  310. };
  311. struct value
  312.   {
  313.     enum lval_type lval;
  314.     union
  315.       {
  316.     CORE_ADDR address;
  317.     struct internalvar *internalvar;
  318.     int regnum;
  319.       } location;
  320.     int offset;    
  321.     int bitsize;
  322.     int bitpos;
  323.     CORE_ADDR frame_addr;
  324.     struct type *type;
  325.     struct value *next;
  326.     short repeated;
  327.     short repetitions;
  328.     short regno;
  329.     char lazy;
  330.     char optimized_out;
  331.     union {
  332.       long contents[1];
  333.       double force_double_align;
  334. # 104 "./value.h"
  335.     } aligner;
  336.   };
  337. typedef struct value *value;
  338. extern int value_fetch_lazy ();
  339. struct internalvar
  340. {
  341.   struct internalvar *next;
  342.   char *name;
  343.   value value;
  344. };
  345. # 1 "./symtab.h"
  346. # 1 "./gnu_include/obstack.h"
  347. struct _obstack_chunk        
  348. {
  349.   char  *limit;            
  350.   struct _obstack_chunk *prev;    
  351.   char    contents[4];        
  352. };
  353. struct obstack        
  354. {
  355.   long    chunk_size;        
  356.   struct _obstack_chunk* chunk;    
  357.   char    *object_base;        
  358.   char    *next_free;        
  359.   char    *chunk_limit;        
  360.   int    temp;            
  361.   int   alignment_mask;        
  362. # 139 "./gnu_include/obstack.h"
  363.   char  *(*chunkfun) ();     
  364.   void (*freefun) ();        
  365. };
  366. # 183 "./gnu_include/obstack.h"
  367. # 320 "./gnu_include/obstack.h"
  368. # 394 "./gnu_include/obstack.h"
  369. # 412 "./gnu_include/obstack.h"
  370.   extern int _obstack_newchunk ();
  371.   extern int _obstack_free ();
  372.   extern void _obstack_begin ();
  373. # 23 "./symtab.h"
  374. extern struct obstack *symbol_obstack;
  375. extern struct obstack *psymbol_obstack;
  376. # 37 "./symtab.h"
  377. extern char *xmalloc ();
  378. extern void free ();
  379. enum misc_function_type {mf_unknown = 0, mf_text, mf_data, mf_bss, mf_abs};
  380. struct misc_function
  381. {
  382.   char *name;
  383.   CORE_ADDR address;
  384.   char *misc_info;    
  385.   enum misc_function_type type;
  386. };
  387. struct misc_function *misc_function_vector;
  388. int misc_function_count;
  389. enum language {language_unknown, language_c};
  390. struct typevector
  391. {
  392.   int length;            
  393.   struct type *type[1];
  394. };
  395. enum type_code
  396. {
  397.   TYPE_CODE_UNDEF,        
  398.   TYPE_CODE_PTR,        
  399.   TYPE_CODE_ARRAY,        
  400.   TYPE_CODE_STRUCT,        
  401.   TYPE_CODE_UNION,        
  402.   TYPE_CODE_ENUM,        
  403.   TYPE_CODE_FUNC,        
  404.   TYPE_CODE_INT,        
  405.   TYPE_CODE_FLT,        
  406.   TYPE_CODE_VOID,        
  407.   TYPE_CODE_SET,        
  408.   TYPE_CODE_RANGE,        
  409.   TYPE_CODE_PASCAL_ARRAY,    
  410.   TYPE_CODE_ERROR,              
  411.   TYPE_CODE_MEMBER,        
  412.   TYPE_CODE_METHOD,        
  413.   TYPE_CODE_REF,        
  414. };
  415. struct type
  416. {
  417.   enum type_code code;
  418.   char *name;
  419.   unsigned length;
  420.   struct type *target_type;
  421.   struct type *pointer_type;
  422.   struct type *reference_type;
  423.   struct type **arg_types;
  424.   struct type *function_type;
  425.   struct type *main_variant, *next_variant;
  426.   short flags;
  427.   short nfields;
  428.   struct field
  429.     {
  430.       int bitpos;
  431.       int bitsize;
  432.       struct type *type;
  433.       char *name;
  434.     } *fields;
  435.       unsigned char *virtual_field_bits; 
  436.       unsigned char *private_field_bits;
  437.       unsigned char *protected_field_bits;
  438.   short nfn_fields;
  439.   short n_baseclasses;
  440.   int nfn_fields_total;
  441.   struct fn_fieldlist
  442.     {
  443.       char *name;
  444.       int length;
  445.       struct fn_field
  446.     {
  447. # 248 "./symtab.h"
  448.       struct type *type;
  449.       struct type **args;
  450.       char *physname;
  451.       struct type *fcontext;
  452.       int voffset;
  453.     } *fn_fields;
  454.           unsigned char *private_fn_field_bits;
  455.           unsigned char *protected_fn_field_bits;
  456.     } *fn_fieldlists;
  457.   unsigned char via_protected;
  458.   unsigned char via_public;
  459.   struct type *vptr_basetype;
  460.   int vptr_fieldno;
  461. };
  462. struct blockvector
  463. {
  464.   int nblocks;
  465.   struct block *block[1];
  466. };
  467. struct block
  468. {
  469.   CORE_ADDR startaddr, endaddr;
  470.   struct symbol *function;
  471.   struct block *superblock;
  472.   unsigned char gcc_compile_flag;
  473.   int nsyms;
  474.   struct symbol *sym[1];
  475. };
  476. enum namespace
  477. {
  478.   UNDEF_NAMESPACE, VAR_NAMESPACE, STRUCT_NAMESPACE, LABEL_NAMESPACE,
  479. };
  480. enum address_class
  481. {
  482.   LOC_UNDEF,        
  483.   LOC_CONST,        
  484.   LOC_STATIC,        
  485.   LOC_REGISTER,        
  486.   LOC_ARG,        
  487.   LOC_REF_ARG,        
  488.   LOC_REGPARM,        
  489.   LOC_LOCAL,        
  490.   LOC_TYPEDEF,        
  491.   LOC_LABEL,        
  492.   LOC_BLOCK,        
  493.   LOC_CONST_BYTES,    
  494.   LOC_LOCAL_ARG,    
  495. };
  496. struct symbol
  497. {
  498.   char *name;
  499.   enum namespace namespace;
  500.   enum address_class class;
  501.   struct type *type;
  502.   unsigned short line;
  503.   union
  504.     {
  505.       long value;        
  506.       struct block *block;      
  507.       char *bytes;        
  508.       CORE_ADDR address;    
  509.       struct symbol *chain;    
  510.     }
  511.   value;
  512. };
  513. struct partial_symbol
  514. {
  515.   char *name;
  516.   enum namespace namespace;
  517.   enum address_class class;
  518.   union
  519.     {
  520.       long value;
  521.       CORE_ADDR address;
  522.     }
  523.   value;
  524. };
  525. struct sourcevector
  526. {
  527.   int length;            
  528.   struct source *source[1];    
  529. };
  530. struct linetable_entry
  531. {
  532.   int line;
  533.   CORE_ADDR pc;
  534. };
  535. struct linetable
  536. {
  537.   int nitems;
  538.   struct linetable_entry item[1];
  539. };
  540. struct source
  541. {
  542.   char *name;            
  543.   struct linetable contents;
  544. };
  545. struct symtab
  546.   {
  547.     struct symtab *next;
  548.     struct blockvector *blockvector;
  549.     struct linetable *linetable;
  550.     struct typevector *typevector;
  551.     char *filename;
  552.     char *dirname;
  553.     enum free_code {free_nothing, free_contents, free_linetable}
  554.       free_code;
  555.     char *free_ptr;
  556.     int nlines;
  557.     int *line_charpos;
  558.     enum language language;
  559.     char *version;
  560.     char *fullname;
  561. # 559 "./symtab.h"
  562.   };
  563. struct partial_symtab
  564. {
  565.   struct partial_symtab *next;
  566.   char *filename;
  567.   char *symfile_name;
  568.   CORE_ADDR addr;
  569.   int ldsymoff, ldsymlen;
  570.   CORE_ADDR textlow, texthigh;
  571.   struct partial_symtab **dependencies;
  572.   int number_of_dependencies;
  573.   int globals_offset, n_global_syms;
  574.   int statics_offset, n_static_syms;
  575.   struct symtab *symtab;
  576.   void (*read_symtab) ();
  577.   unsigned char readin;
  578. };
  579. struct symtab *symtab_list;
  580. struct partial_symtab *partial_symtab_list;
  581. struct symtab *current_source_symtab;
  582. int current_source_line;
  583. extern struct symtab *lookup_symtab ();
  584. extern struct symbol *lookup_symbol ();
  585. extern struct symbol *lookup_block_symbol ();
  586. extern int lookup_misc_func ();
  587. extern void check_stub_type ();
  588. extern void check_stub_method ();
  589. extern struct type *lookup_primitive_typename ();
  590. extern struct type *lookup_typename ();
  591. extern struct type *lookup_unsigned_typename ();
  592. extern struct type *lookup_struct ();
  593. extern struct type *lookup_union ();
  594. extern struct type *lookup_enum ();
  595. extern struct type *lookup_struct_elt_type ();
  596. extern struct type *lookup_pointer_type ();
  597. extern struct type *lookup_function_type ();
  598. extern struct type *lookup_basetype_type ();
  599. extern struct type *create_array_type ();
  600. extern struct symbol *block_function ();
  601. extern struct symbol *find_pc_function ();
  602. extern int find_pc_partial_function ();
  603. extern void clear_pc_function_cache ();
  604. extern struct partial_symtab *lookup_partial_symtab ();
  605. extern struct partial_symtab *find_pc_psymtab ();
  606. extern struct symtab *find_pc_symtab ();
  607. extern struct partial_symbol *find_pc_psymbol ();
  608. extern int find_pc_misc_function ();
  609. extern int find_pc_line_pc_range ();
  610. extern char *type_name_no_tag ();
  611. extern int contained_in();
  612. extern struct type *lookup_reference_type ();
  613. extern struct type *lookup_member_type ();
  614. extern struct type *lookup_method_type ();
  615. extern struct type *lookup_class ();
  616. extern void smash_to_method_type ();
  617. void smash_to_member_type (
  618. # 836 "./symtab.h"
  619.                );
  620. extern struct type *allocate_stub_method ();
  621. extern void free_all_symtabs ();
  622. extern void free_all_psymtabs ();
  623. extern void free_inclink_symtabs ();
  624. extern void reread_symbols ();
  625. extern struct type *builtin_type_void;
  626. extern struct type *builtin_type_char;
  627. extern struct type *builtin_type_short;
  628. extern struct type *builtin_type_int;
  629. extern struct type *builtin_type_long;
  630. extern struct type *builtin_type_unsigned_char;
  631. extern struct type *builtin_type_unsigned_short;
  632. extern struct type *builtin_type_unsigned_int;
  633. extern struct type *builtin_type_unsigned_long;
  634. extern struct type *builtin_type_float;
  635. extern struct type *builtin_type_double;
  636. extern struct type *builtin_type_error;
  637. extern struct type *builtin_type_long_long;
  638. extern struct type *builtin_type_unsigned_long_long;
  639. # 872 "./symtab.h"
  640. struct symtab_and_line
  641. {
  642.   struct symtab *symtab;
  643.   int line;
  644.   CORE_ADDR pc;
  645.   CORE_ADDR end;
  646. };
  647. struct symtabs_and_lines
  648. {
  649.   struct symtab_and_line *sals;
  650.   int nelts;
  651. };
  652. struct symtab_and_line find_pc_line ();
  653. extern CORE_ADDR find_line_pc ();
  654. extern int find_line_pc_range ();
  655. struct symtabs_and_lines decode_line_spec ();
  656. struct symtabs_and_lines decode_line_spec_1 ();
  657. struct symtabs_and_lines decode_line_1 ();
  658. void free_symtab ();
  659. struct symtab *psymtab_to_symtab ();
  660. void clear_solib ();
  661. void symbol_file_add ();
  662. int identify_source_line ();
  663. void print_source_lines ();
  664. void forget_cached_source_info (
  665. # 925 "./symtab.h"
  666.                 );
  667. void select_source_symtab (
  668. # 930 "./symtab.h"
  669.                );
  670. char **make_symbol_completion_list ();
  671. extern CORE_ADDR entry_point;
  672. # 183 "./value.h"
  673. long value_as_long (
  674. # 186 "./value.h"
  675.                );
  676. double value_as_double (
  677. # 191 "./value.h"
  678.             );
  679. CORE_ADDR value_as_pointer (
  680. # 196 "./value.h"
  681.                 );
  682. long unpack_long (
  683. # 201 "./value.h"
  684.              );
  685. double unpack_double (
  686. # 206 "./value.h"
  687.               );
  688. CORE_ADDR unpack_pointer (
  689. # 211 "./value.h"
  690.               );
  691. long unpack_field_as_long ();
  692. value value_from_long ();
  693. value value_from_double ();
  694. value value_at ();
  695. value value_at_lazy ();
  696. value value_from_register ();
  697. value value_of_variable ();
  698. value value_of_register ();
  699. value read_var_value ();
  700. value locate_var_value ();
  701. value allocate_value ();
  702. value allocate_repeat_value ();
  703. value value_mark ();
  704. void value_free_to_mark ();
  705. value value_string ();
  706. value value_binop ();
  707. value value_add ();
  708. value value_sub ();
  709. value value_coerce_array ();
  710. value value_coerce_function ();
  711. value value_ind ();
  712. value value_addr ();
  713. value value_assign ();
  714. value value_neg ();
  715. value value_lognot ();
  716. value value_struct_elt (), value_struct_elt_for_address ();
  717. value value_field (), value_primitive_field ();
  718. value value_cast ();
  719. value value_zero ();
  720. value value_repeat ();
  721. value value_subscript ();
  722. value value_from_vtable_info ();
  723. value value_being_returned ();
  724. int using_struct_return ();
  725. void set_return_value ();
  726. value evaluate_expression ();
  727. value evaluate_type ();
  728. value parse_and_eval ();
  729. value parse_to_comma_and_eval ();
  730. extern CORE_ADDR parse_and_eval_address ();
  731. extern CORE_ADDR parse_and_eval_address_1 ();
  732. value access_value_history ();
  733. value value_of_internalvar ();
  734. void set_internalvar ();
  735. void set_internalvar_component ();
  736. struct internalvar *lookup_internalvar ();
  737. int value_equal ();
  738. int value_less ();
  739. int value_zerop ();
  740. value value_of_this ();
  741. value value_static_field ();
  742. value value_x_binop ();
  743. value value_x_unop ();
  744. value value_fn_field ();
  745. value value_virtual_fn_field ();
  746. int binop_user_defined_p ();
  747. int unop_user_defined_p ();
  748. int typecmp ();
  749. void fill_in_vptr_fieldno ();
  750. int destructor_name_p ();
  751. void free_all_values ();
  752. void release_value ();
  753. int record_latest_value ();
  754. void registers_changed ();
  755. void read_register_bytes ();
  756. void write_register_bytes ();
  757. void read_register_gen ();
  758. CORE_ADDR read_register ();
  759. void write_register ();
  760. void supply_register ();
  761. void get_saved_register ();
  762. void modify_field ();
  763. void type_print ();
  764. void type_print_1 ();
  765. enum val_prettyprint {
  766.   Val_no_prettyprint = 0,
  767.   Val_prettyprint,
  768.   Val_pretty_default
  769.   };
  770. char *baseclass_addr ();
  771. void print_floating ();
  772. int value_print ();
  773. int val_print ();
  774. void print_variable_value ();
  775. char *internalvar_name ();
  776. void clear_value_history ();
  777. void clear_internalvars ();
  778. # 108 "./breakpoint.h"
  779. struct bpstat__struct
  780. {
  781.   bpstat next;
  782.   struct breakpoint *breakpoint_at;
  783.   struct command_line *commands;
  784.   value old_val;
  785.   char print;
  786.   char stop;
  787.   char momentary;
  788. };
  789. # 23 "./inferior.h"
  790. # 1 "./frame.h"
  791. # 129 "./frame.h"
  792. # 26 "./inferior.h"
  793. struct inferior_status {
  794.   int pc_changed;
  795.   int stop_signal;
  796.   int stop_pc;
  797.   FRAME_ADDR stop_frame_address;
  798.   bpstat stop_bpstat;
  799.   int stop_step;
  800.   int stop_stack_dummy;
  801.   int stopped_by_random_signal;
  802.   int trap_expected;
  803.   CORE_ADDR step_range_start;
  804.   CORE_ADDR step_range_end;
  805.   FRAME_ADDR step_frame_address;
  806.   int step_over_calls;
  807.   CORE_ADDR step_resume_break_address;
  808.   int stop_after_trap;
  809.   int stop_soon_quietly;
  810.   FRAME_ADDR selected_frame_address;
  811.   int selected_level;
  812.   char stop_registers[(73*4)];
  813.   int breakpoint_proceeded;
  814.   int restore_stack_info;
  815.   int proceed_to_finish;
  816. };
  817. void save_inferior_status (), restore_inferior_status ();
  818. extern char *inferior_io_terminal;
  819. extern int inferior_pid;
  820. extern char registers[];
  821. extern void clear_proceed_status ();
  822. extern void start_inferior ();
  823. extern void proceed ();
  824. extern void kill_inferior ();
  825. extern void kill_inferior_fast ();
  826. extern void generic_mourn_inferior ();
  827. extern void terminal_ours ();
  828. extern void detach ();
  829. extern void run_stack_dummy ();
  830. extern CORE_ADDR read_pc ();
  831. extern void write_pc ();
  832. extern void wait_for_inferior ();
  833. extern void init_wait_for_inferior ();
  834. extern void close_exec_file ();
  835. extern void reopen_exec_file ();
  836. void attach_command (
  837. # 94 "./inferior.h"
  838.              );
  839. extern int stop_signal;
  840. extern CORE_ADDR stop_pc;
  841. extern FRAME_ADDR stop_frame_address;
  842. extern bpstat stop_bpstat;
  843. extern int breakpoint_proceeded;
  844. extern int stop_step;
  845. extern int stop_stack_dummy;
  846. extern int stopped_by_random_signal;
  847. extern CORE_ADDR step_range_start; 
  848. extern CORE_ADDR step_range_end; 
  849. extern FRAME_ADDR step_frame_address;
  850. extern int step_over_calls;
  851. extern int step_multi;
  852. extern int proceed_to_finish;
  853. extern char stop_registers[(73*4)];
  854. extern int pc_changed;
  855. int attach_flag;
  856. # 185 "./inferior.h"
  857. # 198 "./inferior.h"
  858. # 203 "./inferior.h"
  859. # 33 "ds3100.md/mips-tdep.c"
  860. # 1 "./symtab.h"
  861. # 938 "./symtab.h"
  862. # 34 "ds3100.md/mips-tdep.c"
  863. # 1 "./value.h"
  864. # 317 "./value.h"
  865. # 35 "ds3100.md/mips-tdep.c"
  866. # 1 "./gdbcmd.h"
  867. # 1 "./command.h"
  868. typedef enum cmd_types {
  869.   not_set_cmd,
  870.   set_cmd,
  871.   show_cmd,
  872. } cmd_types;
  873. typedef enum var_types {
  874.   var_boolean,
  875.   var_uinteger,
  876.   var_string,
  877.   var_string_noescape,
  878.   var_filename,
  879.   var_zinteger,
  880. } var_types;
  881. struct cmd_list_element
  882.   {
  883.     struct cmd_list_element *next;
  884.     char *name;
  885.     enum command_class class;
  886.     void (*function) ();
  887.     char *doc;
  888.     char *aux;
  889.     struct cmd_list_element **prefixlist;
  890.     char *prefixname;
  891.     char allow_unknown;
  892.     char abbrev_flag;
  893.     char **(*completer)();
  894.     cmd_types type;
  895.     char *var;
  896.     var_types var_type;
  897.     struct command_line *user_commands;
  898.   };
  899. extern struct cmd_list_element *add_cmd ();
  900. extern struct cmd_list_element *add_alias_cmd ();
  901. extern struct cmd_list_element *add_prefix_cmd ();
  902. extern struct cmd_list_element *add_abbrev_prefix_cmd ();
  903. extern struct cmd_list_element *lookup_cmd (), *lookup_cmd_1 ();
  904. extern void add_com ();
  905. extern void add_com_alias ();
  906. extern void add_info ();
  907. extern void add_info_alias ();
  908. extern char **complete_on_cmdlist ();
  909. extern void delete_cmd ();
  910. extern void help_cmd ();
  911. void help_list (
  912. # 139 "./command.h"
  913.         );
  914. void help_cmd_list (
  915. # 145 "./command.h"
  916.             );
  917. extern struct cmd_list_element *add_set_cmd ();
  918. extern struct cmd_list_element *add_show_from_set ();
  919. extern void do_setshow_command ();
  920. extern void cmd_show_list ();
  921. extern void error_no_arg ();        
  922. extern void dont_repeat ();        
  923. # 19 "./gdbcmd.h"
  924. extern struct cmd_list_element *cmdlist;
  925. extern struct cmd_list_element *infolist;
  926. extern struct cmd_list_element *enablelist;
  927. extern struct cmd_list_element *disablelist;
  928. extern struct cmd_list_element *deletelist;
  929. extern struct cmd_list_element *enablebreaklist;
  930. extern struct cmd_list_element *setlist;
  931. extern struct cmd_list_element *unsetlist;
  932. extern struct cmd_list_element *showlist;
  933. extern struct cmd_list_element *sethistlist;
  934. extern struct cmd_list_element *showhistlist;
  935. extern struct cmd_list_element *unsethistlist;
  936. extern struct cmd_list_element *setprintlist;
  937. extern struct cmd_list_element *showprintlist;
  938. void execute_command ();
  939. char **noop_completer ();
  940. # 36 "ds3100.md/mips-tdep.c"
  941. # 39 "ds3100.md/mips-tdep.c"
  942. # 1 "/sprite/lib/include/sys/param.h"
  943. # 1 "/sprite/lib/include/sys/types.h"
  944. typedef    unsigned char    u_char;
  945. typedef    unsigned short    u_short;
  946. typedef    unsigned int    u_int;
  947. typedef    unsigned long    u_long;
  948. typedef    unsigned short    ushort;        
  949. # 46 "/sprite/lib/include/sys/types.h"
  950. # 52 "/sprite/lib/include/sys/types.h"
  951. typedef struct _quad {long val[2]; } quad;
  952. typedef    struct    _uquad {unsigned long val[2]; } u_quad;
  953. typedef    long    daddr_t;
  954. typedef    char *    caddr_t;
  955. typedef    long *    qaddr_t;    
  956. typedef    u_long    ino_t;
  957. typedef    long    swblk_t;
  958. typedef    int    size_t;
  959. typedef    long    time_t;
  960. typedef    long    clock_t;
  961. typedef    short    dev_t;
  962. typedef    long    off_t;
  963. typedef    short    uid_t;
  964. typedef    short    gid_t;
  965. typedef long    key_t;        
  966. typedef long    fd_mask;
  967. typedef    struct fd_set {
  968.     fd_mask    fds_bits[    (((256)+(( (sizeof(fd_mask) * 8        )    )-1))/( (sizeof(fd_mask) * 8        )    ))];
  969. } fd_set;
  970. # 27 "/sprite/lib/include/sys/param.h"
  971. # 1 "/sprite/lib/include/signal.h"
  972. # 1 "/sprite/lib/include/cfuncproto.h"
  973. # 76 "/sprite/lib/include/cfuncproto.h"
  974. # 14 "/sprite/lib/include/signal.h"
  975. extern void (*signal 
  976.     ())     ();
  977. extern int sigblock     ();
  978. extern int sigpause     ();
  979. extern int sigsetmask     ();
  980. struct    sigvec {
  981.     void    (*sv_handler)();    
  982.     int    sv_mask;        
  983.     int    sv_flags;        
  984. };
  985. struct    sigstack {
  986.     char    *ss_sp;            
  987.     int    ss_onstack;        
  988. };
  989. # 116 "/sprite/lib/include/signal.h"
  990. # 125 "/sprite/lib/include/signal.h"
  991. # 28 "/sprite/lib/include/sys/param.h"
  992. # 1 "/sprite/lib/include/machparam.h"
  993. # 1 "/sprite/lib/include/machine/limits.h"
  994. # 39 "/sprite/lib/include/machparam.h"
  995. # 29 "/sprite/lib/include/sys/param.h"
  996. # 91 "/sprite/lib/include/sys/param.h"
  997. # 43 "ds3100.md/mips-tdep.c"
  998. # 1 "/sprite/lib/include/sys/dir.h"
  999. # 1 "/sprite/lib/include/sys/types.h"
  1000. # 106 "/sprite/lib/include/sys/types.h"
  1001. # 13 "/sprite/lib/include/sys/dir.h"
  1002. struct    direct {
  1003.     u_long    d_ino;            
  1004.     u_short    d_reclen;        
  1005.     u_short    d_namlen;        
  1006.     char    d_name[255 + 1];    
  1007. };
  1008. typedef struct _dirdesc {
  1009.     int    dd_fd;
  1010.     long    dd_loc;
  1011.     long    dd_size;
  1012.     char    dd_buf[512];
  1013. } DIR;
  1014. # 78 "/sprite/lib/include/sys/dir.h"
  1015. extern    DIR *opendir();
  1016. extern    struct direct *readdir();
  1017. extern    long telldir();
  1018. extern    void seekdir();
  1019. extern    void closedir();
  1020. # 44 "ds3100.md/mips-tdep.c"
  1021. # 1 "/sprite/lib/include/ds3100.md/kernel/ultrixSignal.h"
  1022. # 217 "/sprite/lib/include/ds3100.md/kernel/ultrixSignal.h"
  1023. # 46 "ds3100.md/mips-tdep.c"
  1024. # 48 "ds3100.md/mips-tdep.c"
  1025. # 1 "/sprite/lib/include/sys/ioctl.h"
  1026. # 1 "/sprite/lib/include/sys/ttychars.h"
  1027. struct ttychars {
  1028.     char    tc_erase;    
  1029.     char    tc_kill;    
  1030.     char    tc_intrc;    
  1031.     char    tc_quitc;    
  1032.     char    tc_startc;    
  1033.     char    tc_stopc;    
  1034.     char    tc_eofc;    
  1035.     char    tc_brkc;    
  1036.     char    tc_suspc;    
  1037.     char    tc_dsuspc;    
  1038.     char    tc_rprntc;    
  1039.     char    tc_flushc;    
  1040.     char    tc_werasc;    
  1041.     char    tc_lnextc;    
  1042. };
  1043. # 15 "/sprite/lib/include/sys/ioctl.h"
  1044. # 1 "/sprite/lib/include/sys/ttydev.h"
  1045. # 18 "/sprite/lib/include/sys/ioctl.h"
  1046. # 1 "/sprite/lib/include/sys/fb.h"
  1047. typedef struct    fbtype {
  1048.     int    fb_type;    
  1049.     int    fb_height;    
  1050.     int    fb_width;    
  1051.     int    fb_depth;    
  1052.     int    fb_cmsize;    
  1053.     int    fb_size;    
  1054. } fbtype;
  1055. typedef struct    fbinfo {
  1056.     int        fb_physaddr;    
  1057.     int        fb_hwwidth;    
  1058.     int        fb_hwheight;    
  1059.     int        fb_addrdelta;    
  1060.     unsigned char    *fb_ropaddr;    
  1061.     int        fb_unit;    
  1062. } fbinfo;
  1063. typedef struct    fbcmap {
  1064.     int        index;        
  1065.     int        count;        
  1066.     unsigned char    *red;        
  1067.     unsigned char    *green;        
  1068.     unsigned char    *blue;        
  1069. } fbcmap;
  1070. typedef struct fbsattr {
  1071.     int    flags;            
  1072.     int    emu_type;        
  1073.     int    dev_specific[8    ];    
  1074. } fbsattr;
  1075. typedef struct fbgattr {
  1076.     int    real_type;        
  1077.     int    owner;            
  1078.     struct    fbtype fbtype;        
  1079.     struct    fbsattr sattr;        
  1080.     int    emu_types[4    ];    
  1081. } fbgattr;
  1082. struct    fbpixrect {
  1083.     struct pixrect    *fbpr_pixrect;    
  1084. };
  1085. # 22 "/sprite/lib/include/sys/ioctl.h"
  1086. # 1 "/sprite/lib/include/cfuncproto.h"
  1087. # 76 "/sprite/lib/include/cfuncproto.h"
  1088. # 25 "/sprite/lib/include/sys/ioctl.h"
  1089. struct tchars {
  1090.     char    t_intrc;    
  1091.     char    t_quitc;    
  1092.     char    t_startc;    
  1093.     char    t_stopc;    
  1094.     char    t_eofc;        
  1095.     char    t_brkc;        
  1096. };
  1097. struct ltchars {
  1098.     char    t_suspc;    
  1099.     char    t_dsuspc;    
  1100.     char    t_rprntc;    
  1101.     char    t_flushc;    
  1102.     char    t_werasc;    
  1103.     char    t_lnextc;    
  1104. };
  1105. struct sgttyb {
  1106.     char    sg_ispeed;        
  1107.     char    sg_ospeed;        
  1108.     char    sg_erase;        
  1109.     char    sg_kill;        
  1110.     short    sg_flags;        
  1111. };
  1112. struct winsize {
  1113.     unsigned short    ws_row;            
  1114.     unsigned short    ws_col;            
  1115.     unsigned short    ws_xpixel;        
  1116.     unsigned short    ws_ypixel;        
  1117. };
  1118. struct ttysize {
  1119.     unsigned short    ts_lines;
  1120.     unsigned short    ts_cols;
  1121.     unsigned short    ts_xxx;
  1122.     unsigned short    ts_yyy;
  1123. };
  1124. extern int ioctl     ();
  1125. # 50 "ds3100.md/mips-tdep.c"
  1126. # 1 "./gdbcore.h"
  1127. # 1 "./gnu_include/bfd.h"
  1128. # 1 "./gnu_include/ansidecl.h"
  1129. # 89 "./gnu_include/ansidecl.h"
  1130. # 44 "./gnu_include/bfd.h"
  1131. # 1 "./gnu_include/obstack.h"
  1132. # 418 "./gnu_include/obstack.h"
  1133. # 45 "./gnu_include/bfd.h"
  1134. # 50 "./gnu_include/bfd.h"
  1135. typedef struct _bfd bfd;
  1136. typedef enum boolean {false, true} boolean;
  1137. typedef  long int file_ptr;
  1138. # 83 "./gnu_include/bfd.h"
  1139. typedef struct {int a,b;} bfd_64_type;
  1140. typedef unsigned long rawdata_offset;
  1141. typedef unsigned long bfd_vma;
  1142. typedef unsigned long bfd_offset;
  1143. typedef unsigned long bfd_word;
  1144. typedef unsigned long bfd_size;
  1145. typedef unsigned long symvalue;
  1146. typedef unsigned long bfd_size_type;
  1147. typedef unsigned int flagword;    
  1148. typedef enum bfd_format {
  1149.           bfd_unknown = 0,    
  1150.           bfd_object,    
  1151.           bfd_archive,    
  1152.           bfd_core,        
  1153.           bfd_type_end}    
  1154.          bfd_format;
  1155. typedef unsigned long symindex;
  1156. typedef enum bfd_symclass {
  1157.           bfd_symclass_unknown = 0,
  1158.           bfd_symclass_fcommon, 
  1159.           bfd_symclass_global, 
  1160.           bfd_symclass_debugger, 
  1161.           bfd_symclass_undefined 
  1162.         } symclass;
  1163. typedef int symtype;        
  1164. typedef struct carsym {
  1165.   char *name;
  1166.   file_ptr file_offset;        
  1167. } carsym;            
  1168. struct orl {            
  1169.   char **name;             
  1170.   file_ptr pos;            
  1171.   int namidx;            
  1172. };
  1173. typedef struct lineno_cache_entry {
  1174.   unsigned int line_number;      
  1175.   union {
  1176.  struct symbol_cache_entry *sym;        
  1177.     unsigned long offset;    
  1178.   } u;
  1179. } alent;
  1180. typedef struct sec *sec_ptr;
  1181. typedef struct stat stat_type; 
  1182. typedef enum bfd_error {
  1183.           no_error = 0, system_call_error, invalid_target,
  1184.           wrong_format, invalid_operation, no_memory,
  1185.           no_symbols, no_relocation_info,
  1186.           no_more_archived_files, malformed_archive,
  1187.           symbol_not_found, file_not_recognized,
  1188.           file_ambiguously_recognized, no_contents,
  1189.         bfd_error_nonrepresentable_section,
  1190.           invalid_error_code} bfd_ec;
  1191. extern bfd_ec bfd_error;
  1192. typedef struct bfd_error_vector {
  1193.  void (* nonrepresentable_section ) ();
  1194. } bfd_error_vector_type;
  1195.  char *  bfd_errmsg ();
  1196.  void  bfd_perror ();
  1197. typedef enum bfd_print_symbol
  1198.   bfd_print_symbol_name_enum,
  1199.   bfd_print_symbol_type_enum,
  1200.   bfd_print_symbol_all_enum
  1201. } bfd_print_symbol_enum_type;
  1202. # 237 "./gnu_include/bfd.h"
  1203. extern  short _bfd_host_big_endian;
  1204.   bfd*  bfd_openr ();
  1205.  bfd *  bfd_fdopenr ();
  1206.   bfd *  bfd_openw ();
  1207.   boolean  bfd_close ();
  1208.   bfd *  bfd_create ();
  1209.   bfd_size_type bfd_alloc_size ();
  1210. enum bfd_architecture 
  1211. {
  1212.   bfd_arch_unknown,   
  1213.   bfd_arch_obscure,   
  1214.   bfd_arch_m68k,      
  1215.   bfd_arch_vax,          
  1216.   bfd_arch_i960,      
  1217.   bfd_arch_a29k,      
  1218.   bfd_arch_sparc,     
  1219.   bfd_arch_mips,      
  1220.   bfd_arch_i386,      
  1221.   bfd_arch_ns32k,     
  1222.   bfd_arch_tahoe,     
  1223.   bfd_arch_i860,      
  1224.   bfd_arch_romp,      
  1225.   bfd_arch_alliant,   
  1226.   bfd_arch_convex,    
  1227.   bfd_arch_m88k,      
  1228.   bfd_arch_pyramid,   
  1229.   bfd_arch_h8_300,    
  1230.   bfd_arch_last
  1231.   };
  1232.   char * bfd_printable_arch_mach ();
  1233.  boolean  bfd_scan_arch_mach ();
  1234.  boolean  bfd_arch_compatible ();
  1235. typedef struct sec {
  1236.      char *name;
  1237.     struct sec *next;
  1238. flagword flags;
  1239.    bfd_vma vma;
  1240.    bfd_size_type size;    
  1241.    bfd_vma output_offset;
  1242.    struct sec *output_section;
  1243.    unsigned int alignment_power;
  1244.    struct reloc_cache_entry *relocation;
  1245.    struct reloc_cache_entry **orelocation;
  1246.    unsigned reloc_count;
  1247.    int index;                      
  1248.    file_ptr filepos;      
  1249.    file_ptr rel_filepos;
  1250.    file_ptr line_filepos;
  1251.        char * userdata;
  1252.    struct lang_output_section *otheruserdata;
  1253.    alent *lineno;
  1254.    unsigned int lineno_count;
  1255.    file_ptr moving_line_filepos;
  1256.    unsigned int target_index;
  1257.        char * used_by_bfd;
  1258.    struct relent_chain *constructor_chain;
  1259.    bfd *owner;
  1260. } asection ;
  1261.  asection *  bfd_get_section_by_name ();
  1262.   asection *  bfd_make_section ();
  1263.  boolean  bfd_set_section_flags ();
  1264.  void  bfd_map_over_sections ();
  1265.  boolean  bfd_set_section_size ();
  1266.  boolean  bfd_set_section_contents ();
  1267.  boolean  bfd_get_section_contents ();
  1268. typedef struct symbol_cache_entry 
  1269. {
  1270.   struct _bfd *the_bfd;
  1271.     char *name;
  1272.    symvalue value;
  1273.   flagword flags;
  1274.   struct sec *section;
  1275.       char * udata;    
  1276. } asymbol;
  1277.   boolean  bfd_set_symtab ();
  1278.   void  bfd_print_symbol_vandf ();
  1279. struct _bfd 
  1280. {
  1281.    char *filename;                
  1282.   struct bfd_target *xvec;
  1283.   char *iostream;
  1284.   boolean cacheable;
  1285.   boolean target_defaulted;
  1286.   struct _bfd *lru_prev, *lru_next;
  1287.   file_ptr where;              
  1288.   boolean opened_once;
  1289.   boolean mtime_set;
  1290.   long mtime;          
  1291. int ifd;
  1292.   bfd_format format;
  1293.   enum bfd_direction {no_direction = 0,
  1294.                        read_direction = 1,
  1295.                        write_direction = 2,
  1296.                        both_direction = 3} direction;
  1297.   flagword flags;              
  1298.   file_ptr origin;             
  1299.   boolean output_has_begun;
  1300.   struct sec  *sections;
  1301.   unsigned int section_count;
  1302.   bfd_vma start_address;
  1303.   unsigned int symcount;
  1304.   struct symbol_cache_entry  **outsymbols;             
  1305.   enum bfd_architecture obj_arch;
  1306.   unsigned long obj_machine;
  1307.       char * arelt_data;              
  1308.   struct _bfd *my_archive;     
  1309.   struct _bfd *next;           
  1310.   struct _bfd *archive_head;   
  1311.   boolean has_armap;           
  1312.       char * tdata;
  1313.       char * usrdata;
  1314.   struct obstack memory;
  1315. };
  1316.   boolean  bfd_set_start_address ();
  1317.   long  bfd_get_mtime ();
  1318.   symindex  bfd_get_next_mapent ();
  1319.   boolean  bfd_set_archive_head ();
  1320.   bfd *  bfd_get_elt_at_index ();
  1321.  bfd*  bfd_openr_next_archived_file ();
  1322.    char *  bfd_core_file_failing_command ();
  1323.   int  bfd_core_file_failing_signal ();
  1324.  boolean  core_file_matches_executable_p ();
  1325. typedef enum bfd_reloc_status {
  1326.   bfd_reloc_ok,
  1327.   bfd_reloc_overflow,
  1328.   bfd_reloc_outofrange,
  1329.   bfd_reloc_continue,
  1330.   bfd_reloc_notsupported,
  1331.   bfd_reloc_other,
  1332.   bfd_reloc_undefined,
  1333.   bfd_reloc_dangerous
  1334.    }
  1335.  bfd_reloc_status_enum_type;
  1336. typedef struct reloc_cache_entry 
  1337. {
  1338.   struct symbol_cache_entry **sym_ptr_ptr;
  1339.   rawdata_offset address;
  1340.   bfd_vma addend;    
  1341.   struct sec *section;
  1342.    struct reloc_howto_struct *howto;
  1343. } arelent;
  1344. typedef  struct reloc_howto_struct 
  1345.   unsigned int type;
  1346.   unsigned int rightshift;
  1347.   unsigned int size;
  1348.   unsigned int bitsize;
  1349.   boolean pc_relative;
  1350.   unsigned int bitpos;
  1351.   boolean absolute;
  1352.   boolean complain_on_overflow;
  1353.   bfd_reloc_status_enum_type (*special_function)();
  1354.   char *name;
  1355.   boolean partial_inplace;
  1356.   bfd_word src_mask;
  1357.   bfd_word dst_mask;           
  1358.   boolean pcrel_offset;
  1359. } reloc_howto_type;
  1360. typedef unsigned char bfd_byte;
  1361. typedef struct relent_chain {
  1362.   arelent relent;
  1363.   struct   relent_chain *next;
  1364. } arelent_chain;
  1365.  bfd_reloc_status_enum_type 
  1366.                 bfd_perform_relocation ();
  1367. typedef struct bfd_target
  1368. {
  1369.   char *name;
  1370.   enum target_flavour_enum {
  1371.     bfd_target_aout_flavour_enum,
  1372.     bfd_target_coff_flavour_enum,
  1373.     bfd_target_ieee_flavour_enum,
  1374.     bfd_target_oasys_flavour_enum,
  1375.     bfd_target_srec_flavour_enum} flavour;
  1376.   boolean byteorder_big_p;
  1377.   boolean header_byteorder_big_p;
  1378.   flagword object_flags;       
  1379.   flagword section_flags;
  1380.   char ar_pad_char;            
  1381.  unsigned short ar_max_namelen;
  1382.   unsigned int align_power_min;
  1383.                     bfd_vma (*      bfd_getx64) ();
  1384.                     void (*         bfd_putx64) ();
  1385.                     bfd_vma (* bfd_getx32) ();
  1386.                     void (*         bfd_putx32) ();
  1387.                     bfd_vma (* bfd_getx16) ();
  1388.                     void (*         bfd_putx16) ();
  1389.                     bfd_vma (*   bfd_h_getx64) ();
  1390.                     void (*          bfd_h_putx64) ();
  1391.                     bfd_vma (*  bfd_h_getx32) ();
  1392.                     void (*          bfd_h_putx32) ();
  1393.                     bfd_vma (*  bfd_h_getx16) ();
  1394.                     void (*          bfd_h_putx16) ();
  1395.                     struct bfd_target * (* _bfd_check_format[bfd_type_end]) ();
  1396.                     boolean (*            _bfd_set_format[bfd_type_end]) ();
  1397.                     boolean (*            _bfd_write_contents[bfd_type_end]) ();
  1398.                     char * (* _core_file_failing_command) ();
  1399.                     int (*    _core_file_failing_signal) ();
  1400.                     boolean (* _core_file_matches_executable_p) ();
  1401.                    boolean (* _bfd_slurp_armap) ();
  1402.                    boolean (* _bfd_slurp_extended_name_table) ();
  1403.                    void (*   _bfd_truncate_arname) ();
  1404.  boolean (* write_armap) ();
  1405.                     boolean (* _close_and_cleanup) ();
  1406.  boolean (* _bfd_set_section_contents) ();
  1407.  boolean (* _bfd_get_section_contents) ();
  1408.                     boolean (* _new_section_hook) ();
  1409.                    unsigned int (* _get_symtab_upper_bound) ();
  1410.  unsigned int (* _bfd_canonicalize_symtab) ();
  1411.                     unsigned int (* _get_reloc_upper_bound) ();
  1412.  unsigned int (* _bfd_canonicalize_reloc) ();
  1413.                     struct symbol_cache_entry  * (* _bfd_make_empty_symbol) ();
  1414.  void (*     _bfd_print_symbol) ();
  1415.                     alent * (*   _get_lineno) ();
  1416.  boolean (*   _bfd_set_arch_mach) ();
  1417.                     bfd * (*  openr_next_archived_file) ();
  1418.  boolean (* _bfd_find_nearest_line) ();
  1419.                     int (*    _bfd_stat_arch_elt) ();
  1420.                     int (*    _bfd_sizeof_headers) ();
  1421.                     void (* _bfd_debug_info_start) ();
  1422.                     void (* _bfd_debug_info_end) ();
  1423.                     void (* _bfd_debug_info_accumulate) ();
  1424.  void (* _bfd_coff_swap_aux_in) ();
  1425.  void (* _bfd_coff_swap_sym_in) ();
  1426.  void (* _bfd_coff_swap_lineno_in) ();
  1427. } bfd_target;
  1428.   bfd_target *  bfd_find_target ();
  1429.    char ** bfd_target_list ();
  1430.   boolean  bfd_check_format ();
  1431.   boolean bfd_set_format ();
  1432.    char *  bfd_format_string ();
  1433. # 23 "./gdbcore.h"
  1434. char *get_exec_file ();
  1435. int have_core_file_p ();
  1436. int read_memory_nobpt ();
  1437. void memory_error ();
  1438. void read_memory ();
  1439. long read_memory_integer ();
  1440. void write_memory ();
  1441. extern void (*exec_file_display_hook) ();
  1442. extern bfd *core_bfd;
  1443. extern bfd *exec_bfd;
  1444. void core_file_command ();
  1445. void exec_file_command ();
  1446. void validate_files ();
  1447. unsigned int register_addr ();
  1448. int xfer_core_file ();
  1449. void fetch_core_registers ();
  1450. void registers_fetched ();
  1451. # 70 "./gdbcore.h"
  1452. # 53 "ds3100.md/mips-tdep.c"
  1453. # 59 "ds3100.md/mips-tdep.c"
  1454. # 1 "/sprite/lib/include/sys/user.h"
  1455. # 1 "/sprite/lib/include/sys/param.h"
  1456. # 93 "/sprite/lib/include/sys/param.h"
  1457. # 24 "/sprite/lib/include/sys/user.h"
  1458. # 1 "/sprite/lib/include/sys/time.h"
  1459. # 1 "/sprite/lib/include/cfuncproto.h"
  1460. # 76 "/sprite/lib/include/cfuncproto.h"
  1461. # 14 "/sprite/lib/include/sys/time.h"
  1462. struct timeval {
  1463.     long    tv_sec;        
  1464.     long    tv_usec;    
  1465. };
  1466. struct timezone {
  1467.     int    tz_minuteswest;    
  1468.     int    tz_dsttime;    
  1469. };
  1470. struct    itimerval {
  1471.     struct    timeval it_interval;    
  1472.     struct    timeval it_value;    
  1473. };
  1474. # 1 "/sprite/lib/include/time.h"
  1475. # 1 "/sprite/lib/include/cfuncproto.h"
  1476. # 76 "/sprite/lib/include/cfuncproto.h"
  1477. # 13 "/sprite/lib/include/time.h"
  1478. # 18 "/sprite/lib/include/time.h"
  1479. struct tm {
  1480.     int    tm_sec;
  1481.     int    tm_min;
  1482.     int    tm_hour;
  1483.     int    tm_mday;
  1484.     int    tm_mon;
  1485.     int    tm_year;
  1486.     int    tm_wday;
  1487.     int    tm_yday;
  1488.     int    tm_isdst;
  1489.     long    tm_gmtoff;
  1490.     char    *tm_zone;
  1491. };
  1492.         extern clock_t clock     ();
  1493.         extern time_t time     ();
  1494.         extern time_t mktime     ();
  1495.         extern double difftime     ();
  1496.         extern struct tm *gmtime     ();
  1497.         extern struct tm *localtime     ();
  1498.         extern char *asctime     ();
  1499.         extern char *ctime     ();
  1500.         extern int strftime 
  1501.     ();
  1502. # 62 "/sprite/lib/include/sys/time.h"
  1503.         extern int    getitimer     ();
  1504.         extern int    gettimeofday 
  1505.     ();
  1506.         extern int    settimeofday 
  1507.     ();
  1508.         extern int    setitimer 
  1509.     ();
  1510.         extern int    utimes 
  1511.     ();
  1512. # 25 "/sprite/lib/include/sys/user.h"
  1513. # 1 "/sprite/lib/include/sys/resource.h"
  1514. struct    rusage {
  1515.     struct timeval ru_utime;    
  1516.     struct timeval ru_stime;    
  1517.     long    ru_maxrss;
  1518.     long    ru_ixrss;        
  1519.     long    ru_idrss;        
  1520.     long    ru_isrss;        
  1521.     long    ru_minflt;        
  1522.     long    ru_majflt;        
  1523.     long    ru_nswap;        
  1524.     long    ru_inblock;        
  1525.     long    ru_oublock;        
  1526.     long    ru_msgsnd;        
  1527.     long    ru_msgrcv;        
  1528.     long    ru_nsignals;        
  1529.     long    ru_nvcsw;        
  1530.     long    ru_nivcsw;        
  1531. };
  1532. struct rlimit {
  1533.     int    rlim_cur;        
  1534.     int    rlim_max;        
  1535. };
  1536. # 26 "/sprite/lib/include/sys/user.h"
  1537. # 1 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1538. # 53 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1539. # 1 "/sprite/lib/include/ds3100.md/filehdr.h"
  1540. struct filehdr {
  1541.     unsigned short    f_magic;    
  1542.     unsigned short    f_nscns;    
  1543.     long        f_timdat;    
  1544.     long        f_symptr;    
  1545.     long        f_nsyms;    
  1546.     unsigned short    f_opthdr;    
  1547.     unsigned short    f_flags;    
  1548.     };
  1549. # 56 "/sprite/lib/include/ds3100.md/filehdr.h"
  1550. # 106 "/sprite/lib/include/ds3100.md/filehdr.h"
  1551. # 167 "/sprite/lib/include/ds3100.md/filehdr.h"
  1552. # 63 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1553. # 1 "/sprite/lib/include/ds3100.md/aouthdr.h"
  1554. # 42 "/sprite/lib/include/ds3100.md/aouthdr.h"
  1555. typedef    struct aouthdr {
  1556.     short    magic;        
  1557.     short    vstamp;        
  1558.     long    tsize;        
  1559.     long    dsize;        
  1560.     long    bsize;        
  1561. # 54 "/sprite/lib/include/ds3100.md/aouthdr.h"
  1562.     long    entry;        
  1563.     long    text_start;    
  1564.     long    data_start;    
  1565.     long    bss_start;    
  1566.     long    gprmask;    
  1567.     long    cprmask[4];    
  1568.     long    gp_value;    
  1569. } AOUTHDR;
  1570. # 89 "/sprite/lib/include/ds3100.md/aouthdr.h"
  1571. # 64 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1572. # 1 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1573. struct scnhdr {
  1574.     char        s_name[8];    
  1575.     long        s_paddr;    
  1576.     long        s_vaddr;    
  1577.     long        s_size;        
  1578.     long        s_scnptr;    
  1579.     long        s_relptr;    
  1580.     long        s_lnnoptr;    
  1581.     unsigned short    s_nreloc;    
  1582.     unsigned short    s_nlnno;    
  1583.     long        s_flags;    
  1584.     };
  1585. # 64 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1586. # 73 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1587. # 119 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1588. # 150 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1589. # 199 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1590. # 243 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1591. union gp_table {
  1592.   struct {
  1593.     long current_g_value; 
  1594.     long unused;
  1595.   } header;
  1596.   struct {
  1597.     long g_value; 
  1598.     long bytes;    
  1599.   } entry;
  1600. };
  1601. # 295 "/sprite/lib/include/ds3100.md/scnhdr.h"
  1602. struct libscn {
  1603.     long    size;        
  1604.     long    offset;        
  1605.     long    tsize;        
  1606.     long    dsize;        
  1607.     long    bsize;        
  1608.     long    text_start;    
  1609.     long    data_start;    
  1610.     long    bss_start;    
  1611. };
  1612. # 65 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1613. # 105 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1614. struct exec {
  1615.     struct filehdr    ex_f;
  1616.     struct aouthdr    ex_o;
  1617. };
  1618. # 130 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1619. # 157 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1620. # 164 "/sprite/lib/include/ds3100.md/sys/exec.h"
  1621. # 27 "/sprite/lib/include/sys/user.h"
  1622. # 1 "/sprite/lib/include/errno.h"
  1623. extern int    errno;        
  1624. extern int    sys_nerr;    
  1625. extern char    *sys_errlist[];    
  1626. # 28 "/sprite/lib/include/sys/user.h"
  1627. # 65 "ds3100.md/mips-tdep.c"
  1628. # 1 "/sprite/lib/include/sys/file.h"
  1629. # 66 "ds3100.md/mips-tdep.c"
  1630. # 1 "/sprite/lib/include/sys/stat.h"
  1631. # 1 "/sprite/lib/include/cfuncproto.h"
  1632. # 76 "/sprite/lib/include/cfuncproto.h"
  1633. # 14 "/sprite/lib/include/sys/stat.h"
  1634. struct    stat
  1635. {
  1636.     dev_t    st_dev;
  1637.     ino_t    st_ino;
  1638.     unsigned short st_mode;
  1639.     short    st_nlink;
  1640.     uid_t    st_uid;
  1641.     gid_t    st_gid;
  1642.     dev_t    st_rdev;
  1643.     off_t    st_size;
  1644.     time_t    st_atime;
  1645.     int    st_spare1;
  1646.     time_t    st_mtime;
  1647.     int    st_spare2;
  1648.     time_t    st_ctime;
  1649.     int    st_spare3;
  1650.     long    st_blksize;
  1651.     long    st_blocks;
  1652.     long    st_serverID;
  1653.     long    st_version;
  1654.     long    st_userType;
  1655.     long    st_devServerID;
  1656. };
  1657. extern int fstat     ();
  1658. extern int lstat     ();
  1659. extern int stat     ();
  1660. extern int mkdir     ();
  1661. # 67 "ds3100.md/mips-tdep.c"
  1662. struct linked_proc_info
  1663. {
  1664.   struct mips_extra_func_info info;
  1665.   struct linked_proc_info *next;
  1666. } * linked_proc_desc_table = 0;
  1667. int
  1668. read_next_frame_reg(fi, regno)
  1669.      FRAME fi;
  1670.      int regno;
  1671. {
  1672.   for (; fi; fi = fi->next)
  1673.       if (in_sigtramp(fi->pc, 0)) {
  1674.       int offset;
  1675.       if (regno == 37        ) offset = (-  sizeof(struct sigcontext)+ 2*sizeof(int));
  1676.       else if (regno == 31        ) offset = (-  sizeof(struct sigcontext)+34*sizeof(int));
  1677.       else if (regno == 29        ) offset = (-  sizeof(struct sigcontext)+32*sizeof(int));
  1678.       else return 0;
  1679.       return read_memory_integer(fi->frame + offset, 4);
  1680.       }
  1681.       else if (regno == 29        ) return fi->frame;
  1682.       else if (fi->saved_regs->regs[regno])
  1683.     return read_memory_integer(fi->saved_regs->regs[regno], 4);
  1684.   return read_register(regno);
  1685. }
  1686. int
  1687. mips_frame_saved_pc(frame)
  1688.      FRAME frame;
  1689. {
  1690.   mips_extra_func_info_t proc_desc = (mips_extra_func_info_t)frame->proc_desc;
  1691.   int pcreg = proc_desc ?  ((proc_desc)->pcreg) : 31        ;
  1692.   if (proc_desc &&  ((proc_desc)->isym == 0x0F0F0F0F))
  1693.       return read_memory_integer(frame->frame - 4, 4);
  1694. # 139 "ds3100.md/mips-tdep.c"
  1695.   return read_next_frame_reg(frame, pcreg);
  1696. }
  1697. static struct mips_extra_func_info temp_proc_desc;
  1698. static struct frame_saved_regs temp_saved_regs;
  1699. CORE_ADDR heuristic_proc_start(pc)
  1700.     CORE_ADDR pc;
  1701. {
  1702.     CORE_ADDR start_pc = pc;
  1703.     CORE_ADDR fence = start_pc - 10000;
  1704.     if (fence < (unsigned)0x400000) fence = (unsigned)0x400000;
  1705.     for (start_pc -= 4; ; start_pc -= 4)
  1706.     if (start_pc < fence) return 0; 
  1707.     else if ( (read_memory_integer (start_pc, 4) == 0x3e00008))
  1708.         break;
  1709.     start_pc += 8; 
  1710. # 164 "ds3100.md/mips-tdep.c"
  1711.     return start_pc;
  1712. }
  1713. mips_extra_func_info_t
  1714. heuristic_proc_desc(start_pc, limit_pc, next_frame)
  1715.     CORE_ADDR start_pc, limit_pc;
  1716.     FRAME next_frame;
  1717. {
  1718.     CORE_ADDR sp = next_frame ? next_frame->frame : read_register (29        );
  1719.     CORE_ADDR cur_pc;
  1720.     int frame_size;
  1721.     int has_frame_reg = 0;
  1722.     int reg30; 
  1723.     unsigned long reg_mask = 0;
  1724.     if (start_pc == 0) return 0;
  1725.     bzero(&temp_proc_desc, sizeof(temp_proc_desc));
  1726.     bzero(&temp_saved_regs, sizeof(struct frame_saved_regs));
  1727.     if (start_pc + 200 < limit_pc) limit_pc = start_pc + 200;
  1728.   restart:
  1729.     frame_size = 0;
  1730.     for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4) {
  1731.     unsigned long word;
  1732.     int status;
  1733.     status = read_memory_nobpt (cur_pc, &word, 4); 
  1734.     if (status) memory_error (status, cur_pc); 
  1735.     if ((word & 0xFFFF0000) == 0x27bd0000) 
  1736.         frame_size += (-word) & 0xFFFF;
  1737.     else if ((word & 0xFFFF0000) == 0x23bd0000) 
  1738.         frame_size += (-word) & 0xFFFF;
  1739.     else if ((word & 0xFFE00000) == 0xafa00000) { 
  1740.         int reg = (word & 0x001F0000) >> 16;
  1741.         reg_mask |= 1 << reg;
  1742.         temp_saved_regs.regs[reg] = sp + (short)word;
  1743.     }
  1744.     else if ((word & 0xFFFF0000) == 0x27be0000) { 
  1745.         if ((unsigned short)word != frame_size)
  1746.         reg30 = sp + (unsigned short)word;
  1747.         else if (!has_frame_reg) {
  1748.         int alloca_adjust;
  1749.         has_frame_reg = 1;
  1750.         reg30 = read_next_frame_reg(next_frame, 30);
  1751.         alloca_adjust = reg30 - (sp + (unsigned short)word);
  1752.         if (alloca_adjust > 0) {
  1753.             sp += alloca_adjust;
  1754.             goto restart;
  1755.         }
  1756.         }
  1757.     }
  1758.     else if ((word & 0xFFE00000) == 0xafc00000) { 
  1759.         int reg = (word & 0x001F0000) >> 16;
  1760.         reg_mask |= 1 << reg;
  1761.         temp_saved_regs.regs[reg] = reg30 + (short)word;
  1762.     }
  1763.     }
  1764.     if (has_frame_reg) {
  1765.      ((&temp_proc_desc)->framereg) = 30;
  1766.      ((&temp_proc_desc)->framesize) = 0;
  1767.     }
  1768.     else {
  1769.      ((&temp_proc_desc)->framereg) = 29        ;
  1770.      ((&temp_proc_desc)->framesize) = frame_size;
  1771.     }
  1772.      ((&temp_proc_desc)->regmask) = reg_mask;
  1773.      ((&temp_proc_desc)->pcreg) = 31        ;
  1774.     return &temp_proc_desc;
  1775. }
  1776. mips_extra_func_info_t
  1777. find_proc_desc(pc, next_frame)
  1778.     CORE_ADDR pc;
  1779.     FRAME next_frame;
  1780. {
  1781.   mips_extra_func_info_t proc_desc;
  1782.   extern struct block *block_for_pc();
  1783.   struct block   *b = block_for_pc(pc);
  1784.   struct symbol *sym =
  1785.       b ? lookup_symbol(".gdbinfo.", b, LABEL_NAMESPACE, 0, 0) : 0;
  1786.   if (sym != 0)
  1787.     {
  1788.     proc_desc = (struct mips_extra_func_info *)sym->value.value;
  1789.     if (next_frame == 0) {
  1790.         struct symtab_and_line val;
  1791.         struct symbol *proc_symbol =
  1792.          ((proc_desc)->isym == 0x0F0F0F0F) ? 0 :  (*(struct symbol**)&(proc_desc)->isym);
  1793.         if (proc_symbol) {
  1794.         val = find_pc_line (
  1795.  ( (proc_symbol)->value.block)->startaddr,
  1796.                     0);
  1797.         val.pc = val.end ? val.end : pc;
  1798.         }
  1799.         if (!proc_symbol || pc < val.pc) {
  1800.         mips_extra_func_info_t found_heuristic =
  1801.             heuristic_proc_desc( ((proc_desc)->adr) ,
  1802.                     pc, next_frame);
  1803.         if (found_heuristic) proc_desc = found_heuristic;
  1804.         }
  1805.     }
  1806.     }
  1807.   else
  1808.     {
  1809.       register struct linked_proc_info *link;
  1810.       for (link = linked_proc_desc_table; link; link = link->next)
  1811.       if ( ((&link->info)->adr)  <= pc
  1812.           &&  ((&link->info)->pad2)  > pc)
  1813.           return &link->info;
  1814.       proc_desc =
  1815.       heuristic_proc_desc(heuristic_proc_start(pc), pc, next_frame);
  1816.     }
  1817.   return proc_desc;
  1818. }
  1819. mips_extra_func_info_t cached_proc_desc;
  1820. FRAME_ADDR mips_frame_chain(frame)
  1821.     FRAME frame;
  1822. {
  1823.     extern CORE_ADDR startup_file_start;    
  1824.     mips_extra_func_info_t proc_desc;
  1825.     CORE_ADDR saved_pc =     (mips_frame_saved_pc(frame));
  1826.     if (startup_file_start)
  1827.       { 
  1828.     if (saved_pc == 0 || !outside_startup_file (saved_pc)) return 0;
  1829.       }
  1830.     else
  1831.       { 
  1832.         if (saved_pc == 0
  1833.         || read_memory_integer (saved_pc + 8, 4) & 0xFC00003F == 0xD)
  1834.         return 0;  
  1835.       }
  1836.     proc_desc = find_proc_desc(saved_pc, frame);
  1837.     if (!proc_desc) return 0;
  1838.     cached_proc_desc = proc_desc;
  1839.     return read_next_frame_reg(frame,  ((proc_desc)->framereg))
  1840.     +  ((proc_desc)->framesize);
  1841. }
  1842. void
  1843. init_extra_frame_info(fci)
  1844.      struct frame_info *fci;
  1845. {
  1846.   extern struct obstack frame_cache_obstack;
  1847.   mips_extra_func_info_t proc_desc = fci->next ? cached_proc_desc :
  1848.       find_proc_desc(fci->pc, fci->next);
  1849.   fci->saved_regs = (struct frame_saved_regs*)
  1850.                              (                        ( ((&frame_cache_obstack))->temp = ( ( sizeof(struct frame_saved_regs))),                              ((((&frame_cache_obstack))->chunk_limit - ((&frame_cache_obstack))->next_free < ((&frame_cache_obstack))->temp)               ? _obstack_newchunk (((&frame_cache_obstack)), ((&frame_cache_obstack))->temp) : 0),                  ((&frame_cache_obstack))->next_free += ((&frame_cache_obstack))->temp),                           ( ((&frame_cache_obstack))->temp =  ((((&frame_cache_obstack))->object_base) - (char *)0),                  ((&frame_cache_obstack))->next_free                                =  ((( ((((&frame_cache_obstack))->next_free) - (char *)0)+((&frame_cache_obstack))->alignment_mask)                & ~ (((&frame_cache_obstack))->alignment_mask)) + (char *)0),                  ((((&frame_cache_obstack))->next_free - (char *)((&frame_cache_obstack))->chunk                        > ((&frame_cache_obstack))->chunk_limit - (char *)((&frame_cache_obstack))->chunk)                   ? (((&frame_cache_obstack))->next_free = ((&frame_cache_obstack))->chunk_limit) : 0),                  ((&frame_cache_obstack))->object_base = ((&frame_cache_obstack))->next_free,                       ((((&frame_cache_obstack))->temp) + (char *)0)));
  1851.   bzero(fci->saved_regs, sizeof(struct frame_saved_regs));
  1852.   fci->proc_desc =
  1853.       proc_desc == &temp_proc_desc ? (char*)0 : (char*)proc_desc;
  1854.   if (proc_desc)
  1855.     {
  1856.       int ireg;
  1857.       CORE_ADDR reg_position;
  1858.       unsigned long mask;
  1859.       int kernel_trap =  ((proc_desc)->regmask) & 1;
  1860.       if (fci->pc ==  ((proc_desc)->adr) )
  1861.       fci->frame = read_register (29        );
  1862.       else
  1863.       fci->frame =  read_next_frame_reg((fci)->next,   ((proc_desc)->framereg))
  1864.           +  ((proc_desc)->framesize);
  1865.       if (proc_desc == &temp_proc_desc)
  1866.       *fci->saved_regs = temp_saved_regs;
  1867.       else
  1868.       {
  1869.       reg_position = fci->frame +  ((proc_desc)->regoffset);
  1870.       mask = kernel_trap ? 0xFFFFFFFF :  ((proc_desc)->regmask);
  1871.       for (ireg= 31; mask; --ireg, mask <<= 1)
  1872.           if (mask & 0x80000000)
  1873.           {
  1874.           fci->saved_regs->regs[ireg] = reg_position;
  1875.           reg_position -= 4;
  1876.           }
  1877.       reg_position = fci->frame +  ((proc_desc)->fregoffset);
  1878.       reg_position += 4;
  1879.       mask = kernel_trap ? 0xFFFFFFFF :  ((proc_desc)->fregmask);
  1880.       for (ireg = 31; mask; --ireg, mask <<= 1)
  1881.           if (mask & 0x80000000)
  1882.           {
  1883.           fci->saved_regs->regs[32+ireg] = reg_position;
  1884.           reg_position -= 4;
  1885.           }
  1886.       }
  1887.       if (( ((proc_desc)->regmask) & 0xF0) == 0) fci->num_args = -1;
  1888.       else if (( ((proc_desc)->regmask) & 0x80) == 0) fci->num_args = 4;
  1889.       else if (( ((proc_desc)->regmask) & 0x40) == 0) fci->num_args = 3;
  1890.       else if (( ((proc_desc)->regmask) & 0x20) == 0) fci->num_args = 2;
  1891.       else if (( ((proc_desc)->regmask) & 0x10) == 0) fci->num_args = 1;
  1892.       fci->saved_regs->regs[37        ] = fci->saved_regs->regs[31        ];
  1893.     }
  1894.   if (fci->next == 0)
  1895.       supply_register(72        , &fci->frame);
  1896. }
  1897. CORE_ADDR mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
  1898.   int nargs;
  1899.   value *args;
  1900.   CORE_ADDR sp;
  1901.   int struct_return;
  1902.   CORE_ADDR struct_addr;
  1903. {
  1904.   CORE_ADDR buf;
  1905.   register i;
  1906.   int accumulate_size = struct_return ? 4 : 0;
  1907.   struct mips_arg { char *contents; int len; int offset; };
  1908.   struct mips_arg *mips_args =
  1909.       (struct mips_arg*)alloca(nargs * sizeof(struct mips_arg));
  1910.   register struct mips_arg *m_arg;
  1911.   for (i = 0, m_arg = mips_args; i < nargs; i++, m_arg++) {
  1912.     extern value value_arg_coerce();
  1913.     value arg = value_arg_coerce (args[i]);
  1914.     m_arg->len =  ( (arg)->type)->length;
  1915.     if (m_arg->len > 4) accumulate_size = (accumulate_size + 7) & -8;
  1916.     m_arg->offset = accumulate_size;
  1917.     accumulate_size = (accumulate_size + m_arg->len + 3) & -4;
  1918.     m_arg->contents =  ((void)( (arg)->lazy && value_fetch_lazy(arg)),                  ((char *) (arg)->aligner.contents));
  1919.   }
  1920.   accumulate_size = (accumulate_size + 7) & (-8);
  1921.   if (accumulate_size < 16) accumulate_size = 16; 
  1922.   sp -= accumulate_size;
  1923.   for (i = nargs; m_arg--, --i >= 0; )
  1924.     write_memory(sp + m_arg->offset, m_arg->contents, m_arg->len);
  1925.   if (struct_return) {
  1926.     buf = struct_addr;
  1927.     write_memory(sp, &buf, sizeof(CORE_ADDR));
  1928. }
  1929.   return sp;
  1930. }
  1931. void
  1932. mips_push_dummy_frame()
  1933. {
  1934.   int ireg;
  1935.   struct linked_proc_info *link = (struct linked_proc_info*)
  1936.       xmalloc(sizeof(struct linked_proc_info));
  1937.   mips_extra_func_info_t proc_desc = &link->info;
  1938.   CORE_ADDR sp = read_register (29        );
  1939.   CORE_ADDR save_address;
  1940.   long buffer;
  1941.   link->next = linked_proc_desc_table;
  1942.   linked_proc_desc_table = link;
  1943.    ((proc_desc)->regmask) =  ((1 << (16)+1)-1 ^ (1 << (1))-1)| ((1 << (28)+1)-1 ^ (1 << (24))-1)|(1<<31);
  1944.    ((proc_desc)->fregmask) =  ((1 << (19)+1)-1 ^ (1 << (0))-1);
  1945.    ((proc_desc)->regoffset) = 
  1946.       -sizeof(long) - 4 * 4;
  1947.    ((proc_desc)->fregoffset) = 
  1948.       -sizeof(double) - 4 * (4 + 22);
  1949.   save_address = sp +  ((proc_desc)->regoffset);
  1950.   for (ireg = 32; --ireg >= 0; )
  1951.     if ( ((proc_desc)->regmask) & (1 << ireg))
  1952.       {
  1953.     buffer = read_register (ireg);
  1954.     write_memory (save_address, &buffer, sizeof(long));
  1955.     save_address -= 4;
  1956.       }
  1957.   save_address = sp +  ((proc_desc)->fregoffset);
  1958.   for (ireg = 32; --ireg >= 0; )
  1959.     if ( ((proc_desc)->fregmask) & (1 << ireg))
  1960.       {
  1961.     buffer = read_register (ireg);
  1962.     write_memory (save_address, &buffer, 4);
  1963.     save_address -= 4;
  1964.       }
  1965.   write_register (16 , sp);
  1966.    ((proc_desc)->framereg) = 16 ;
  1967.    ((proc_desc)->framesize) = 0;
  1968.   buffer = read_register (37        );
  1969.   write_memory (sp - 4, &buffer, sizeof(long));
  1970.   buffer = read_register (34            );
  1971.   write_memory (sp - 8, &buffer, sizeof(long));
  1972.   buffer = read_register (33            );
  1973.   write_memory (sp - 12, &buffer, sizeof(long));
  1974.   buffer = read_register (70         );
  1975.   write_memory (sp - 16, &buffer, sizeof(long));
  1976.   sp -= 4 * (22+20+4);
  1977.   write_register (29        , sp);
  1978.    ((proc_desc)->adr)  = sp - (16*4) + 12;
  1979.    ((proc_desc)->pad2)  = sp;
  1980.    ((proc_desc)->isym = 0x0F0F0F0F);
  1981.    ((proc_desc)->pcreg) = 31        ;
  1982. }
  1983. void
  1984. mips_pop_frame()
  1985. { register int regnum;
  1986.   FRAME frame = get_current_frame ();
  1987.   CORE_ADDR new_sp = frame->frame;
  1988.   mips_extra_func_info_t proc_desc = (mips_extra_func_info_t)frame->proc_desc;
  1989.   if ( ((proc_desc)->isym == 0x0F0F0F0F))
  1990.     {
  1991.       struct linked_proc_info **ptr = &linked_proc_desc_table;;
  1992.       for (; &ptr[0]->info != proc_desc; ptr = &ptr[0]->next )
  1993.       if (ptr[0] == 0) abort();
  1994.       *ptr = ptr[0]->next;
  1995.       free (ptr[0]);
  1996.       write_register (34            , read_memory_integer(new_sp - 8, 4));
  1997.       write_register (33            , read_memory_integer(new_sp - 12, 4));
  1998.       write_register (70         , read_memory_integer(new_sp - 16, 4));
  1999.     }
  2000.   write_register (37        ,     (mips_frame_saved_pc(frame)));
  2001.   if (frame->proc_desc) {
  2002.     for (regnum = 32; --regnum >= 0; )
  2003.       if ( ((proc_desc)->regmask) & (1 << regnum))
  2004.     write_register (regnum,
  2005.           read_memory_integer (frame->saved_regs->regs[regnum], 4));
  2006.     for (regnum = 64; --regnum >= 32; )
  2007.       if ( ((proc_desc)->fregmask) & (1 << regnum))
  2008.     write_register (regnum,
  2009.           read_memory_integer (frame->saved_regs->regs[regnum], 4));
  2010.   }
  2011.   write_register (29        , new_sp);
  2012.   flush_cached_frames ();
  2013.   set_current_frame (create_new_frame (new_sp, read_pc ()));
  2014. }
  2015. static
  2016. mips_print_register(regnum, all)
  2017.      int regnum, all;
  2018. {
  2019.       unsigned char raw_buffer[8];
  2020.       long val;
  2021.       read_relative_register_raw_bytes (regnum, raw_buffer);
  2022.       if (!(regnum & 1) && regnum >= 38            && regnum < 38           +32) {
  2023.       read_relative_register_raw_bytes (regnum+1, raw_buffer+4);
  2024.       printf_filtered ("(d%d: ", regnum&31);
  2025.       val_print (builtin_type_double, raw_buffer, 0,
  2026.              (&stdioOutFile), 0, 1, 0, Val_pretty_default);
  2027.       printf_filtered ("); ", regnum&31);
  2028.       }
  2029.       fputs_filtered (reg_names[regnum], (&stdioOutFile));
  2030.       if (regnum < 32)
  2031.       printf_filtered ("(r%d): ", regnum);
  2032.       else
  2033.       printf_filtered (": ");
  2034.       if ( ( builtin_type_int)->code == TYPE_CODE_FLT
  2035.       && !     isa_NAN(raw_buffer,  4)) {
  2036.       val_print ( builtin_type_int, raw_buffer, 0,
  2037.              (&stdioOutFile), 0, 1, 0, Val_pretty_default);
  2038.       }
  2039.       else
  2040.     {
  2041.       long val;
  2042.       bcopy (raw_buffer, &val, sizeof (long));
  2043.       if (val == 0)
  2044.         printf_filtered ("0");
  2045.       else if (all)
  2046.         printf_filtered ("0x%x", val);
  2047.       else
  2048.         printf_filtered ("0x%x=%d", val, val);
  2049.     }
  2050. }
  2051. mips_do_registers_info (regnum, fpregs)
  2052.      int regnum;
  2053.      int fpregs;
  2054. {
  2055.   if (regnum != -1) {
  2056.       mips_print_register (regnum, 0);
  2057.       printf_filtered ("\n");
  2058.   }
  2059.   else {
  2060.       for (regnum = 0; regnum < 73; ) {
  2061.       if ((!fpregs) && regnum >= 38            && regnum <= 71         ) {
  2062.         regnum++;
  2063.         continue;
  2064.       }
  2065.       mips_print_register (regnum, 1);
  2066.       regnum++;
  2067.       if ((regnum & 3) == 0 || regnum == 73)
  2068.           printf_filtered (";\n");
  2069.       else
  2070.           printf_filtered ("; ");
  2071.       }
  2072.   }
  2073. }
  2074. mips_frame_num_args(fip)
  2075.     FRAME fip;
  2076. {
  2077. # 627 "ds3100.md/mips-tdep.c"
  2078.     return -1;
  2079. }
  2080. int
  2081. isa_NAN(p, len)
  2082.      int *p, len;
  2083. {
  2084.   int exponent;
  2085.   if (len == 4)
  2086.     {
  2087.       exponent = *p;
  2088.       exponent = exponent << 1 >> (32 -  8 - 1);
  2089.       return ((exponent == -1) || (! exponent && *p));
  2090.     }
  2091.   else if (len == 8)
  2092.     {
  2093.       exponent = *(p+1);
  2094.       exponent = exponent << 1 >> (32 - 11 - 1);
  2095.       return ((exponent == -1) || (! exponent && *p * *(p+1)));
  2096.     }
  2097.   else return 1;
  2098. }
  2099. CORE_ADDR mips_skip_prologue(pc)
  2100.      CORE_ADDR pc;
  2101. {
  2102.     struct symbol *f;
  2103.     struct block *b;
  2104.     unsigned long inst;
  2105.     inst = read_memory_integer(pc, 4);
  2106.     if ((inst & 0xffff0000) == 0x27bd0000)
  2107.     return pc + 4;
  2108.     b = block_for_pc(pc);
  2109.     if (!b) return pc;
  2110.     f = lookup_symbol(".gdbinfo.", b, LABEL_NAMESPACE, 0, 0);
  2111.     if (!f) return pc;
  2112.     if (((struct mips_extra_func_info *)f->value.value)->framesize)
  2113.     return pc + 4;
  2114.     return pc;
  2115. }
  2116.